home *** CD-ROM | disk | FTP | other *** search
- /* Trashcan for Directory Opus 5.5
- by Stefano Regattin
- http://members.tripod.it/esseerre/Stefano.html
- e-mail: stefano.regattin@tin.it
- $VER: Trashcan.dopus5 1.0 (10.3.2001)
- Please change birth date: */
- MyBirthDate=8111966
- LF='0a'x
- Options Results
- Options FailAt 21
- Lib='rmh.library'
- If ~Show('L',Lib) Then
- Do
- If ~AddLib(Lib,0,-30) Then Exit
- If AddLibrary('rexxsupport.library')~=0 Then Exit
- If ~OpenPort(trashport) Then Do
- Say 'I cannot put the trashcan!'
- Exit
- End
- TrashcanMenu.count=3
- TrashcanMenu.0='Recycle'
- TrashcanMenu.1='---'
- TrashcanMenu.2='Empty'
- Argument.count=5
- Dopus AddAppIcon trashport "Trashcan" 'MyBirthDate' icon "ENVARC:Sys/def_trashcan" close info local menu Trashcan Menu
- Icon=RESULT
- Do Until Uscita=1
- Event=PortSignal(trashport)
- If CheckSignal(Event)~=0 Then
- Do
- Packet=GetPkt(trashport)
- If Packet~=Null() Then
- Do
- Do Argument=0 To 4
- Argument.Argument=GetArg(Packet,Argument)
- End
- Call Reply(Packet,0)
- Select
- When Argument.0='dropfrom' Then
- Do
- Lister Query Source
- SourceList=RESULT
- Lister Query SourceList Path
- FilePath=RESULT
- Parse Var FilePath Device ":" FilePath
- FileName=Argument.2
- Parse Var Device "X" Device /* XHF filter */
- File=Device":"FilePath||FileName
- If Exists(File) Then
- Do
- Address Command 'Run Copy 'File' 'Device':Trashcan ALL CLONE'
- Address Command 'Run Delete 'File''
- Dopus Request '"'File' put into the trashcan" OK'
- FileIcon=File".info"
- If Exists(FileIcon) Then
- Do
- Address Command 'Run Copy 'FileIcon' 'Device':Trashcan ALL CLONE'
- Address Command 'Run Delete 'FileIcon''
- Dopus Request '"'FileIcon' put into the trashcan" OK'
- End
- End
- Dopus Script 'Trashcan dropped'
- End
- When Argument.0='menu' Then
- Do
- Select
- When Argument.2=0 Then
- Do
- /* change the devices to suit to your needs */
- Do Device=0 To 6
- Address Command 'Run Copy DH'Device':Trashcan/#? RAM: ALL CLONE'
- Address Command 'Run Delete DH'Device':Trashcan/#? ALL'
- End
- Dopus Request '"I have recycled all the files"'LF'"from all your trashcans"'LF'"to your RAM: device" OK'
- Dopus Script 'Trashcan recycled'
- End
- When Argument.2=2 Then
- Do
- /* change the devices to suit to your needs*/
- Do Device=0 To 6
- Address Command 'Run Delete DH'Device':Trashcan/#? ALL'
- End
- Dopus Request '"I have emptied all the trashcans" OK'
- Dopus Script 'Trashcan emptied'
- End
- Otherwise NOP
- End
- End
- When Argument.0='info' Then
- Do
- Dopus SetAppIcon BUSY ON
- Dopus Request '"stefano.regattin@tin.it"'LF'"http://members.tripod.it/esseerre/Stefano.html" OK'
- Do Until RC~=0
- End
- Dopus SetAppIcon BUSY OFF
- End
- When Argument.0='removed' Then Uscita=1
- When Argument.0='close' Then Uscita=1
- Otherwise NOP
- End
- End
- End
- End
- Call ClosePort(trashport)
- Dopus RemAppIcon Icon
- Dopus Script 'Trashcan removed'
- Exit
- End
-